<template>
	<view class="container">
		<view class="title">
			请选择图片资料
		</view>

		<view class="info">
			<text>包括但不限于化验单, 检查单, 药品图片, 病例等资料</text>
			<text>单张图片不能超过5M</text>
		</view>

		<uni-file-picker class="picker" v-model="imageValue" fileMediatype="image" mode="grid" @select="select" ref="files"
			:auto-upload="false" />

		<button type="primary" @click="upload">上传文件</button>
	</view>
</template>

<script>
export default {
	data() {
		return {
			imageValue: []
		}
	},
	methods: {
		// 获取上传状态
		select(e) {
			console.log('选择文件：', e)
		},
		// 获取上传进度
		progress(e) {
			console.log('上传进度：', e)
		},

		// 上传成功
		success(e) {
			console.log('上传成功')
		},

		// 上传失败
		fail(e) {
			console.log('上传失败：', e)
		},

		upload() {
			this.$refs.files.upload()
		}
	}
}
</script>

<style scoped lang="less">
.container {
	padding: 20rpx;

	.title {
		font-size: 36rpx;
		font-weight: 700;
		line-height: 80rpx;
		border-bottom: 2px solid #CCCCCC;
		margin-bottom: 10rpx;
	}

	/deep/.uni-file-picker {
		margin: 30px 0;
	}
}
</style>
